package com.ufgov.agcfs.manage.entity;

import java.io.Serializable;

public class CompanyNode implements Serializable{
	private static final long serialVersionUID = 807714332969702595L;
	/*
	 	一次性加载的时候不能加children属性
		分级加载的时候才能加
		id,parent,text为必须字段，其他可以根据情况自己加
	*/
	private String id;
	private String parent;
	private String text;
	private String coCode;	
	private String coFullName;
	private Integer dispOrder;
	
	public CompanyNode(){
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getParent() {
		return parent;
	}
	public void setParent(String parent) {
		this.parent = parent;
	}
	
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	
	public String getCoCode() {
		return coCode;
	}
	
	public void setCoCode(String coCode) {
		this.coCode = coCode;
	}

	public String getCoFullName() {
		return coFullName;
	}

	public void setCoFullName(String coFullName) {
		this.coFullName = coFullName;
	}
	
	public Integer getDispOrder() {
		return dispOrder;
	}
	public void setDispOrder(Integer dispOrder) {
		this.dispOrder = dispOrder;
	}
	
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		CompanyNode castOther = (CompanyNode)other;
		return 
			this.id.equals(castOther.id);
	}
	
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.id.hashCode();
		return hash;
	}

	public static CompanyNode createNode(String id, String parent,
										String text, String coCode, String coFullName,
										Integer dispOrder){		
		CompanyNode node = new CompanyNode();
		node.setId(id);
		node.setParent(parent);
		node.setText(text);
		node.setCoCode(coCode);
		node.setCoFullName(coFullName);
		node.setDispOrder(dispOrder);
		return node;
	}

}
